package com.cakemallproject.service.impl;

import com.cakemallproject.mapper.GoodsMapper;
import com.cakemallproject.pojo.mapperObj.Goods;
import com.cakemallproject.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsServiceImpl implements GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    @Override
    public List<Goods> list() {
        return goodsMapper.list();
    }

    @Override
    public void insert(Goods goods) {
        goodsMapper.insert(goods);
    }

    @Override
    public void delete(List<Integer> ids) {
        goodsMapper.delete(ids);
    }

    @Override
    public void update(Goods goods) {
        goodsMapper.update(goods);
    }

    @Override
    public Goods getById(Integer gid) {
        return goodsMapper.getById(gid);
    }

    @Override
    public List<Goods> search(String value, List<Integer> tids) {
        System.out.println("tids = " + tids);
        return goodsMapper.search(value, tids);
    }



    @Override
    public List<Goods> getByTid(Integer tid) {
        return goodsMapper.getByTid(tid);
    }
}
